<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
    <script>
        //超时调用 1000ms
        // setTimeout(function(){
            // alert('hello js')
        // },1000);
        //间歇调用 每隔一段时间调用一次
        setInterval(function(){
            var div = document.querySelector('div');
            div.innerHTML = new Date();
        },1000)
    </script>
</body>
</html>